package com.example.gkcircle.activity;

import android.content.Intent;
import android.os.Handler;

import com.example.gkcircle.BaseActivity;
import com.example.gkcircle.MainActivity;
import com.example.gkcircle.R;
import com.example.gkcircle.guide.GuideActivity;
import com.example.gkcircle.utils.Sputil;

/**启动页
 * Created by Jehu on 16/4/11.
 */
public class StartActivity extends BaseActivity{

    private final int DELAY_TIME=1350;

    @Override
    protected void initView() {
        this.overridePendingTransition(0,R.anim.zoom_in);
        setContentView(R.layout.start_activity);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void setData() {
        final Sputil sputil=new Sputil(this);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if(sputil.isFirstRun(StartActivity.this)){
                    startActivity(new Intent(StartActivity.this, GuideActivity.class));
                }else{
                    startActivity(new Intent(StartActivity.this, MainActivity.class));
                }
                finish();
                overridePendingTransition(0, R.anim.zoom_out);
            }

        }, DELAY_TIME);
    }
}
